package lesson20;

public class Person 
{
	private String name;
	void setName(String name)
	{
		this.name = name;
	}
	boolean hasSameName(Person other) throws PersonException
	{
		try
		{
			return this.name.equals(other.name);
		}
		catch(NullPointerException e)
		{
			System.out.println(e.getStackTrace());
			for (StackTraceElement ste: e.getStackTrace()) 
			{
				System.out.println(ste.getMethodName() + ste.getLineNumber());
			}
			System.out.println("Name of your initial person is Null");
			throw new PersonException();
		}
	}
}
